'   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '                           S I M U L A T O R 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   A f f e c t e d   b y   L o a d   V a r s 
 
 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 L o a d   V a r s 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   N o t   a f f e c t e d   b y   L o a d   V a r s 
 
 
 
 ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 '                                       V a l u e s   i n   C P M 
 
 ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 ' A   B   C   D   s i n g l e                 2 5   . .   5 0 
 
 ' A B , A C , A D , B C , B D , C D       0 . 2 5   . .   1 0 
 
 ' A B C , A B D , A C D , B C D                 2   . . .   4 
 
 ' A B C D                                   0 . 5   . . .   5 
 
 ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 
 
 N u m e r i c   P r o b a b i l i t y _ S i n g l e         =   3 0 
 
 N u m e r i c   P r o b a b i l i t y _ D o u b l e         =   5 
 
 N u m e r i c   P r o b a b i l i t y _ T r i p l e         =   3 
 
 N u m e r i c   P r o b a b i l i t y _ Q u a d r u p l e   =   2 
 
 
 
 N u m e r i c   S o u n d F r e q u e n c y   =   1 0 0 0 
 
 N u m e r i c   S o u n d M i l l i s e c   =   1 0 
 
 N u m e r i c   F i l e s W i t h H e a d e r   =   1 
 
 N u m e r i c   F i r s t O u t p u t S l o t   =   1 
 
 ' 
 
 A r r a y 3   =   1 , 1 0 , 3 0 , 6 0 , 1 2 0 , 1 8 0 , 3 0 0 , 6 0 0     '   L o g   t i m e   S e c 
 
 S t r i n g   H e a d e r   =   " A ; B : C ; D ; A B ; A C ; A D ; B C ; B D ; C D ; A B C ; A B D ; A C D ; B C D ; A B C D " 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 ' 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   L O A D   A P P S 
 
 L o a d   T h e r e m i n o _ S l o t V i e w e r . e x e 
 
 L o a d   T h e r e m i n o _ F i l t e r F I R . e x e 
 
 L o a d   T h e r e m i n o _ G r a p h s . e x e 
 
 ' 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   B U T T O N S 
 
 B u t t o n   1   L a b e l   T e s t O n O f f 
 
 B u t t o n   1   C o l o r   G o l d 
 
 B u t t o n   1   I m a g e 0 S   B u t t o n 3 . p n g 
 
 B u t t o n   6   L a b e l   " R e s e t C o u n t e r s " 
 
 B u t t o n   6   T e x t   " R e s e t   c o u n t e r s " 
 
 B u t t o n   6   C o l o r   G o l d 
 
 B u t t o n   6   I m a g e 0 S   B u t t o n 3 . p n g 
 
 B u t t o n   8   L a b e l   C t r A 
 
 B u t t o n   9   L a b e l   C t r B 
 
 B u t t o n   1 0   L a b e l   C t r C 
 
 B u t t o n   1 1   L a b e l   C t r D 
 
 B u t t o n   1 7   L a b e l   C t r A B 
 
 B u t t o n   1 8   L a b e l   C t r A C 
 
 B u t t o n   1 9   L a b e l   C t r A D 
 
 B u t t o n   2 0   L a b e l   C t r B C 
 
 B u t t o n   2 1   L a b e l   C t r B D 
 
 B u t t o n   2 2   L a b e l   C t r C D 
 
 B u t t o n   2 3   L a b e l   C t r A B C 
 
 B u t t o n   2 4   L a b e l   C t r A B D 
 
 B u t t o n   2 5   L a b e l   C t r A C D 
 
 B u t t o n   2 6   L a b e l   C t r B C D 
 
 B u t t o n   2 7   L a b e l   C t r A B C D 
 
 F o r   v 1   =   8   T o   1 1 
 
 	 B u t t o n   v 1   C o l o r   G r a y 9 
 
 	 B u t t o n   v 1   I m a g e 0 S   B u t t o n 2 . p n g 
 
 N e x t 
 
 F o r   v 1   =   1 7   T o   2 7 
 
 	 B u t t o n   v 1   C o l o r   G r a y 9 
 
 	 B u t t o n   v 1   I m a g e 0 S   B u t t o n 1 . p n g 
 
 N e x t 
 
 B u t t o n   1 3   L a b e l   " S o u n d O n O f f " 
 
 B u t t o n   1 3   C o l o r   G o l d 
 
 B u t t o n   1 3   I m a g e 0 S   B u t t o n 3 . p n g 
 
 B u t t o n   2 9   L a b e l   " L o g O n O f f " 
 
 B u t t o n   2 9   C o l o r   G o l d 
 
 B u t t o n   2 9   I m a g e 0 S   B u t t o n 3 . p n g 
 
 B u t t o n   3 0   L a b e l   L o g T i m e S e c 
 
 B u t t o n   3 0   C o l o r   G o l d 
 
 B u t t o n   3 0   I m a g e 0 S   B u t t o n 3 . p n g 
 
 C o n t r o l s   S e t B a c k C o l o r   L i g h t G o l d e n r o d Y e l l o w 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   S T A R T   A L L 
 
 O p t i o n   S p e e d   9 
 
 U p d a t e B u t t o n s 
 
 I f   L o g E n a b l e d   < >   0 
 
 	 I n i t L o g 
 
 E n d I f 
 
 
 
 R e s e t L a b e l s 
 
 ' R e s e t C o u n t e r s 
 
 L o o p 
 
 S t o p 
 
 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 '     E V E N T   S T O P 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 L a b e l   E v e n t S t o p 
 
 	 S a v e   V a r s 
 
 	 F o r   v 1   =   8   T o   1 1 
 
 	 	 B u t t o n   v 1   C o l o r   G r a y 9 
 
 	 N e x t 
 
 	 F o r   v 1   =   1 7   T o   2 7 
 
 	 	 B u t t o n   v 1   C o l o r   G r a y 9 
 
 	 N e x t 
 
 E n d 
 
 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 '     B U T T O N S 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 N u m e r i c   S y m E n a b l e d 
 
 L a b e l   T e s t O n O f f 
 
 	 I f   S y m E n a b l e d   < >   0 
 
 	 	 S y m E n a b l e d   =   0 
 
 	 E l s e 
 
 	 	 S y m E n a b l e d   =   1 
 
 	 E n d I f 
 
 	 U p d a t e B u t t o n s 
 
 R e t u r n 
 
 
 
 L a b e l   L o g T i m e S e c 
 
 	 N u m e r i c   I n d e x 3 
 
 	 I n d e x 3   =   M o d ( I n d e x 3   +   1 ,   A r r a y L e n g t h ( 3 ) ) 
 
 	 U p d a t e B u t t o n s 
 
 R e t u r n 
 
 
 
 N u m e r i c   L o g E n a b l e d 
 
 L a b e l   L o g O n O f f 
 
 	 I f   L o g E n a b l e d   < >   0 
 
 	 	 L o g E n a b l e d   =   0 
 
 	 E l s e 
 
 	 	 L o g E n a b l e d   =   1 
 
 	 	 I n i t L o g 
 
 	 E n d I f 
 
 	 U p d a t e B u t t o n s 
 
 R e t u r n 
 
 
 
 N u m e r i c   S o u n d E n a b l e d 
 
 L a b e l   S o u n d O n O f f 
 
 	 I f   S o u n d E n a b l e d   < >   0 
 
 	 	 S o u n d E n a b l e d   =   0 
 
 	 E l s e 
 
 	 	 S o u n d E n a b l e d   =   1 
 
 	 E n d I f 
 
 	 U p d a t e B u t t o n s 
 
 R e t u r n 
 
 
 
 L a b e l   U p d a t e B u t t o n s 
 
 	 I f   S y m E n a b l e d   >   0 
 
 	 	 B u t t o n   T e s t O n O f f   T e x t   " S Y M   e n a b l e d " 
 
 	 	 B u t t o n   T e s t O n O f f   C o l o r   O r a n g e 
 
 	 E l s e 
 
 	 	 B u t t o n   T e s t O n O f f   T e x t   " S Y M   d i s a b l e d " 
 
 	 	 B u t t o n   T e s t O n O f f   C o l o r   2 0 0 , 2 5 0 , 1 5 0 
 
 	 E n d I f 
 
 	 I f   L o g E n a b l e d   >   0 
 
 	 	 B u t t o n   L o g O n O f f   T e x t   " L o g   e n a b l e d " 
 
 	 	 B u t t o n   L o g O n O f f   C o l o r   O r a n g e 
 
 	 	 L o g S e c o n d s   =   A r r a y 3 ( I n d e x 3 ) 
 
 	 E l s e 
 
 	 	 B u t t o n   L o g O n O f f   T e x t   " L o g   d i s a b l e d " 
 
 	 	 B u t t o n   L o g O n O f f   C o l o r   2 0 0 , 2 5 0 , 1 5 0 
 
 	 E n d I f 
 
 	 I f   S o u n d E n a b l e d   >   0 
 
 	 	 B u t t o n   S o u n d O n O f f   T e x t   " S o u n d   e n a b l e d " 
 
 	 	 B u t t o n   S o u n d O n O f f   C o l o r   O r a n g e 
 
 	 E l s e 
 
 	 	 B u t t o n   S o u n d O n O f f   T e x t   " S o u n d   d i s a b l e d " 
 
 	 	 B u t t o n   S o u n d O n O f f   C o l o r   2 0 0 , 2 5 0 , 1 5 0 
 
 	 E n d I f 
 
 	 B u t t o n   L o g T i m e S e c   T e x t   " L o g T i m e   "   +   A r r a y 3 ( I n d e x 3 )   +   "   S e c " 
 
 R e t u r n 
 
 
 
 L a b e l   R e s e t C o u n t e r s 
 
 	 F o r   v 1   =   0   T o   1 4 
 
 	 	 A r r a y 8 ( v 1 )   =   0 
 
 	 	 S l o t ( F i r s t O u t p u t S l o t   +   v 1 )   =   0 
 
 	 N e x t 
 
 	 R e s e t L a b e l s 
 
 R e t u r n 
 
 
 
 L a b e l   R e s e t L a b e l s 
 
 	 F o r   v 1   =   0   T o   1 4 
 
 	 	 A r r a y 9 ( v 1 )   =   I n f i n i t y 
 
 	 N e x t 
 
 	 U p d a t e L a b e l s 
 
 	 U p d a t e T i m e r   =   3 
 
 R e t u r n 
 
 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 '     L O O P 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 L a b e l   L o o p 
 
 	 N u m e r i c   U p d a t e T i m e r 
 
 	 S t r i n g   R e c e i v e d L i n e 
 
 	 I f   S y m E n a b l e d   >   0 
 
 	 	 F o r   v 1   =   0   T o   3 
 
 	 	 	 S y m P u l s e ( v 1 ) ( P r o b a b i l i t y _ S i n g l e ) 
 
 	 	 N e x t 
 
 	 	 F o r   v 1   =   4   T o   9 
 
 	 	 	 S y m P u l s e ( v 1 ) ( P r o b a b i l i t y _ D o u b l e ) 
 
 	 	 N e x t 
 
 	 	 F o r   v 1   =   1 0   T o   1 3 
 
 	 	 	 S y m P u l s e ( v 1 ) ( P r o b a b i l i t y _ T r i p l e ) 
 
 	 	 N e x t 
 
 	 	 F o r   v 1   =   1 4   T o   1 4 
 
 	 	 	 S y m P u l s e ( v 1 ) ( P r o b a b i l i t y _ Q u a d r u p l e ) 
 
 	 	 N e x t 
 
 	 E n d I f 
 
 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   U p d a t e   l a b e l s 
 
 	 I f   U p d a t e T i m e r   =   3 
 
 	 	 U p d a t e L a b e l s 
 
 	 	 I f   S o u n d E n a b l e d   =   1 
 
 	 	 	 B e e p   S o u n d F r e q u e n c y   S o u n d M i l l i s e c 
 
 	 	 E n d I f 
 
 	 E n d I f 
 
 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   C l e a r   c o l o r s 
 
 	 I f   U p d a t e T i m e r   > =   0 
 
 	 	 U p d a t e T i m e r   =   U p d a t e T i m e r   -   1 
 
 	 	 I f   U p d a t e T i m e r   <   0 
 
 	 	 	 F o r   v 1   =   7   T o   1 1 
 
 	 	 	 	 B u t t o n   v 1   C o l o r   G r a y 9 
 
 	 	 	 N e x t 
 
 	 	 	 F o r   v 1   =   1 7   T o   2 7 
 
 	 	 	 	 B u t t o n   v 1   C o l o r   G r a y 9 
 
 	 	 	 N e x t 
 
 	 	 E n d I f 
 
 	 E n d I f 
 
 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   L o g 
 
 	 I f   L o g E n a b l e d   >   0 
 
 	 	 E x e c u t e L o g 
 
 	 E n d I f 
 
 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   L o o p   t i m e 
 
 	 W a i t   S e c o n d s   0 . 0 8 5   '   0 . 0 8 5   i n s t e a d   o f   0 . 1   t o   g e t   a b o u t   1 0   H z 
 
 G o t o   L o o p 
 
 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 '     P U L S E   S I M U L A T I O N   -   P r o b a b i l i t y   i n   C P M 
 
 '     P r o b a b i l i t y   i s   d i v i d e d   b y   6 0   ( C P M ) 
 
 '       a n d   f u r t h e r   d i v i d e d   b y   1 0   ( l o o p   f r e q u e n c y ) 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 L a b e l   S y m P u l s e 
 
 	 N u m e r i c   S y m P u l s e I n d e x 
 
 	 N u m e r i c   S y m P u l s e P r o b a b i l i t y 
 
 	 I f   S y m P u l s e P r o b a b i l i t y   /   6 0 0   >   R n d 
 
 	 	 A r r a y 8 ( S y m P u l s e I n d e x )   =   M o d ( A r r a y 8 ( S y m P u l s e I n d e x )   +   1 ,   6 5 5 3 6 ) 
 
 	 	 S l o t ( F i r s t O u t p u t S l o t   +   S y m P u l s e I n d e x )   =   A r r a y 8 ( S y m P u l s e I n d e x ) 
 
 	 	 U p d a t e T i m e r   =   3 
 
 	 E n d I f 
 
 R e t u r n 
 
 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 '     U P D A T E   L A B E L S 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 L a b e l   U p d a t e L a b e l s 
 
 	 S t r i n g   L B L 1   =   " ,         A   ,         B   ,         C   ,         D   , " 
 
 	 S t r i n g   L B L 2   =   " , A B   , A C   , A D   , B C   , B D   , C D   " 
 
 	 L B L 2   =   L B L 2   +   " ,   A B C   ,   A B D   ,   A C D   ,   B C D   ,   A B C D   , " 
 
 	 N u m e r i c   U L 1 
 
 	 S t r i n g   t x t 
 
 	 F o r   U L 1   =   0   T o   3 
 
 	 	 I f   A r r a y 8 ( U L 1 )   < >   A r r a y 9 ( U L 1 ) 
 
 	 	 	 B u t t o n   U L 1 + 8   C o l o r   C o r a l 
 
 	 	 	 t x t   =   G e t S e p a r a t e d S t r i n g ( L B L 1 ,   U L 1 + 1 ,   " , " ) 
 
 	 	 	 B u t t o n   U L 1 + 8   T e x t   t x t   +   A r r a y 8 ( U L 1 ) 
 
 	 	 E n d I f 
 
 	 N e x t 
 
 	 F o r   U L 1   =   4   T o   1 4 
 
 	 	 I f   A r r a y 8 ( U L 1 )   < >   A r r a y 9 ( U L 1 ) 
 
 	 	 	 B u t t o n   U L 1 + 1 3   C o l o r   C o r a l 
 
 	 	 	 t x t   =   G e t S e p a r a t e d S t r i n g ( L B L 2 ,   U L 1 - 3 ,   " , " ) 
 
 	 	 	 B u t t o n   U L 1 + 1 3   T e x t   t x t   +   A r r a y 8 ( U L 1 ) 
 
 	 	 E n d I f 
 
 	 N e x t 
 
 	 F o r   v 1   =   0   T o   1 4 
 
 	 	 A r r a y 9 ( v 1 )   =   A r r a y 8 ( v 1 ) 
 
 	 N e x t 
 
 R e t u r n 
 
 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 '     L O G 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 L a b e l   I n i t L o g 
 
 	 S t r i n g   L o g F i l e   =   " . \ L O G S \ L O G _ F I L E . t x t " 
 
 	 S t r i n g   L o g F i l e C o p y   =   " . \ L O G S \ O L D _ F I L E S \ L O G _ "   +   F o r m a t ( N o w ,   " y y y y - M M - d d _ H H - m m - s s " )   +   " . t x t " 
 
 	 I f   F i l e E x i s t s ( L o g F i l e ) 
 
 	 	 S a v e   S t r i n g T o F i l e   G e t T e x t F i l e ( L o g F i l e )   L o g F i l e C o p y 
 
 	 	 S a v e   D e l e t e F i l e   L o g F i l e 
 
 	 E n d I f 
 
 	 I f   F i l e s W i t h H e a d e r   =   1 
 
 	 	 S a v e   S t r i n g T o F i l e   H e a d e r   L o g F i l e 
 
 	 E n d I f 
 
 	 N u m e r i c   L o g S e c o n d s 
 
 	 N u m e r i c   L o g O l d T i m e   =   - I n f i n i t y 
 
 	 N u m e r i c   L o g N e w T i m e 
 
 R e t u r n 
 
 
 
 
 
 L a b e l   E x e c u t e L o g 
 
 	 L o g N e w T i m e   =   E l a p s e d T i m e 
 
 	 I f   L o g N e w T i m e   -   L o g O l d T i m e   > =   L o g S e c o n d s 
 
 	 	 L o g O l d T i m e   =   L o g N e w T i m e 
 
 	 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   P r e p a r e   L o g L i n e 
 
 	 	 S t r i n g   L o g L i n e   =   " " 
 
 	 	 F o r   v 2   =   0   T o   1 4 
 
 	 	 	 L o g L i n e   =   L o g L i n e   +   G e t S e p a r a t e d S t r i n g ( R e c e i v e d L i n e ,   v 2 )   +   "   " 
 
 	 	 N e x t 
 
 	 	 L o g L i n e   =   T r i m ( L o g L i n e ) 
 
 	 	 L o g L i n e   =   R e p l a c e ( L o g L i n e ,   "   " ,   " ; " ) 
 
 	 	 ' L o g L i n e   =   F o r m a t ( N o w ,   " y y y y / M M / d d   H H : m m : s s . f f f " )   +   " ; "   +   L o g L i n e 
 
 	 	 L o g L i n e   =   F o r m a t ( N o w ,   " y y y y / M M / d d   H H : m m : s s " )   +   " ; "   +   L o g L i n e 
 
 	 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   S a v e   L o g L i n e 
 
 	 	 S a v e   S t r i n g T o F i l e   L o g L i n e   L o g F i l e 
 
 	 E n d I f 
 
 R e t u r n 
 
 
 
 
 
 ' B O O K M A R K S   
 
 
 
 ' E D I T E D L I N E S   2 2   9   1 6   9   1 9 4   2   1 9 7   5   2 0 0   5   2 0 3   5   2 3 6   9   2 3 0   9   2 4 1   8   2 3 4   9   1 7 3   1 0   
 
 
 
 ' W A T C H   d u m m y 
 
 